import request from '@/utils/requset'

// 获取登录验证码
export const getVerifyCode = (): any => request({
  method: 'get',
  url: '/user/verify_code'
})
// 登录
export const userLogin = (data: LoginForm): any => request<{
  data: string
}>({
  method: 'post',
  url: '/user/login',
  data
})
// 用户列表
export const getUserList = (data: any): any => request<{
  data: string
}>({
  method: 'post',
  url: '/user/list',
  data
})
// 添加用户
export const addUser = (data: any): any => request<{
  data: any
}>({
  method: 'post',
  url: '/user/add',
  data
})
// 修改用户信息
export const updateUser = (data: any): any => request<{
  data: any
}>({
  method: 'post',
  url: '/user/update',
  data
})
// 删除用户信息
export const removeUser = (userId: string): any => request({
  method: 'delete',
  url: 'user/remove/' + userId
})
// 获取用户信息
export const getUserInfo = (): any => request({
  method: 'get',
  url: '/user/userInfo'
})
